//
//  YYGiftOrderVC.m
//  drivingSchool
//
//  Created by 子yu 刘 on 2018/9/26.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "YYGiftOrderVC.h"
#import "YYGigtOrderCell.h"

@interface YYGiftOrderVC ()
@property (nonatomic ,strong)NSArray *dataArr;

@end

@implementation YYGiftOrderVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self getData];
}

- (void)getData{
    [RequestOperationManager myGift_success:^(id result) {
        if (DEF_REQ_SUCCESS) {
            self.dataArr = result[@"data"][@"list"];
            if (self.dataArr.count  == 0) {
                self.baseLabel.text = @"暂无订单";
                self.baseImageView.hidden = NO;
            }else{
                [self.tableView reloadData];
            }
        }
    } failture:^(NSError *error) {
        
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArr.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    YYGigtOrderCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YYGigtOrderCell"];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 120;
}

- (NSArray *)dataArr{
    if (!_dataArr) {
        _dataArr = [NSArray array];
    }
    return _dataArr;
}

@end
